
<include file="__THEME__/header" />

<script type="text/javascript" charset="utf-8">
var mini_zishu = '{$stringcount}';
var MID = '{$mid}';
</script>
<script type="text/javascript" src="__PUBLIC__/Js/addBlog.js"></script>
<link href="../Public/index.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Public/home_index.js"></script>
<script type="text/javascript" src="../Public/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="../Public/feed.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/Share.js"></script>


<link href="__PUBLIC__/swfjs/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/swfjs/swfupload/swfupload.js"></script>
<script type="text/javascript" src="__PUBLIC__/swfjs/js/fileprogress.js"></script>
<script type="text/javascript" src="__PUBLIC__/swfjs/js/handlers.js"></script>




<script type="text/javascript"> 
		 
		 var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "__PUBLIC__/swfjs/swfupload/swfupload.swf",
				upload_url: "/apps/mini/index.php?s=Index/uploadpic",
				post_params: {"PHPSESSID" : ""},
				file_size_limit : "100 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 100,
				file_queue_limit : 1,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				//debug: true,

				// Button settings
				button_image_url : "",	// Relative to the SWF file
				button_placeholder_id : "spanButtonPlaceHolder",
				button_width : 90,
				button_height : 22,
				button_text : '<a href="#" class="adddoc">添加照片或文档</a>',
				button_text_style : ".adddoc {color: #005fab;}",
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess
			};

			swfu = new SWFUpload(settings);
	     };

		function start_upload(){
			var content = $( '#xq_con' ).val();
			var status=$('input[name="status"]:checked').val();
			if(!content) {alert("内容不能为空哦~~~");return;}//alert(content);
			//判断如果没有上传图片也可以提交
			    $pna=$('#fsUploadProgress').find('.progressName').text();
				 if($pna==""){
					  
					      $.ajax({
								url: '/apps/mini/index.php?s=Index/addMiniNoPic',
								type: 'POST',
								data:{content:content,status:status}, 
								timeout: 1000,
								error: function(){
									//alert('Error loading XML document');
								},
								success: function(data){
									$( '#xq_con' ).val('');
									var type = $(this).attr("rel");
									  
								 				$("#feed_content").load(APP+"/Home/feed",{type:'all',user:'undefined'});				
																
												}
							});
					  
					  
					 }
					 else{
				       swfu.addPostParam('content',content);
					   swfu.addPostParam('status',status);
				       swfu.startUpload();
					 }

         }
 function fileQueueError(file,errorCode,message) {
	   
 if (errorCode == SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
            alert("上传队列中最多只能有1个文件.");
    return;
        }
 }
 
function uploadSuccess(file, serverData) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setComplete();
		progress.setStatus("Complete.");
		progress.toggleCancel(false);
		$( '#xq_con' ).val('');
		
		if(serverData==0){
			   alert('上传图片返回错误');
				  
			}else{
				 $('#fsUploadProgress').find('.progressName').remove();
				$("#feed_content").load(APP+"/Home/feed",{type:'all',user:'undefined'});
		}
		

	} catch (ex) {
		this.debug(ex);
	}
}
  
	</script>







<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<script>
$(document).ready(function(){
			 
	   $( "#insert_image" ).click(function() {
				$('#upfile').click().change(function(){
									var filepath = $("#upfile").val();
				var pos1 = filepath.lastIndexOf('/');
				var pos2 = filepath.lastIndexOf('\\');
				var pos  = Math.max(pos1, pos2);
			
				if( pos<0 )
				    $('#docfilename').val(filepath);
				else
					var s=filepath.substring(pos+1);
				      $('#docfilename').html(s);				
					 });
		
				
       }); 
			 
		
			 
			 
		$.ajax({
				url: '{:U('getSongList')}',
				type: 'POST',
				dataType: 'json', 
				timeout: 1000,
				error: function(){
					//alert('Error loading XML document');
				},
				success: function(data){
				myPlaylist =new jPlayerPlaylist({
						jPlayer: "#jquery_jplayer_1",
						cssSelectorAncestor: "#jp_container_1"
					},data, {
						swfPath: "js",
						supplied: "oga, mp3",
						wmode: "window"
					});
				}
			});



	$("#jp-openwindow-a").click(function() 
	{	
	
	    	var myPlaylist = new jPlayerPlaylist({
			jPlayer: "#jquery_jplayer_1",
			cssSelectorAncestor: "#jp_container_1"
		},'', {
			playlistOptions: {
				enableRemoveControls: true
			},
			swfPath: "js",
			supplied: "oga, mp3"
		});		
		
		$.ajax({
				url: '{:U('getSong')}',
				type: 'GET',
				dataType: 'html', 
				timeout: 1000,
				error: function(){
					//alert('Error loading XML document');
				},
				success: function(result){
					 $('#music_table').html(result);
					
				}
			});
		 
		  $( "#dialog" ).dialog({
				width:620,
				height:420,
				modal:true,//这个就是遮罩效果
				closeOnEscape: false,
				buttons: {
				 "保存": function() {
					
					 
						$(this).dialog("close");
						
				  }
				 
			  },
			   close: function () {
                       	 $.ajax({
							url: '{:U('getSongList')}',
							type: 'POST',
							dataType: 'json', 
							timeout: 1000,
							error: function(){
								//alert('Error loading XML document');
							},
							success: function(data){
									myPlaylist.setPlaylist(data);
							}
							
						});
                  }
			  
        } );								
										
										
	 });
	
});						   




	function getNextList(p)
	{
			$.ajax({
				url: '{:U('getSong')}',
				type: 'GET',
				data:{p:p}, 
				dataType: 'html', 
				timeout: 1000,
				error: function(){
					alert('Error loading XML document');
				},
				success: function(result){
					 $('#music_table').html(result);
					
				}
			});
	}
	function mystatus(s,ids){
		var m=0;
           if(s.checked){
			   m=1;
			   }
		 $.ajax({
				url: '{:U('insUserSong')}',
				type: 'GET',
				data:{status:m,song_id:ids}, 
				dataType: 'html', 
				timeout: 1000,
				error: function(){
					alert('Error loading XML document');
				},
				success: function(result){
					//alert(result);
					
				}
			});
		/**
		
			
			*/
		}
 </script>

<div id="my_face" style="display:none"><a href="__APP__/space/{$mid}"><img src="{$mid|getUserFace}" /></a></div><!--  隐蔽自己个人图片 -->
<div id="my_name" style="display:none">{$mid|getUserName}</div>


<div class="content"><!-- 内容 begin  -->
    <include file="__THEME__/apps" />
    <div class="main"><!-- 画布 begin  -->
			<php>if($ad["contenttop"]){</php>
					<div class="ad_r_top">{$ad.contenttop}</div>
			<php>}</php>
		
        <div>
            <include file="../Public/home_right" />
            <div class="cc">
			<php>if($gonggao && $gonggao_open){</php>
                <div class="ad_info" id='gonggao' style='display:none;'><div class="right"><a href="javascript:void(0)" onclick='closeGongGao({$mid})' style="display:block;"><img src="../Public/images/ico_del_b.gif" width="9" height="9" alt="关闭" /></a></div><div style="width:506px;">{$gonggao}</div></div>
			<php>}</php>

			<include file="../Public/commonbox" />
			<script type="text/javascript"> 
			  $("#commonbox ul").idTabs(); 
			</script>
			
                <div class="system_info">
                    <div style="width:23%">
                        <a href="{:U('Notify/inbox')}">短消息<span class="<php>if($notify_num['message']){ echo 'cRed fB f14px'; }else{ echo 'cGray2'; }</php> hand">{$notify_num["message"]}</span>条
                        </a>
                    </div>
                    <div style="width:26%">
                        <a href="__APP__/Notify/index/t/sys">系统通知<span class="<php>if($notify_num['notification']){ echo 'cRed fB f14px'; }else{ echo 'cGray2'; }</php> hand">{$notify_num["notification"]}</span>条 </a>
                    </div>
                    <div style="width:26%"><a href="__APP__/Notify/index/t/fri" >评论回复<span class="<php>if($notify_num['friend']){ echo 'cRed fB f14px'; }else{ echo 'cGray2'; }</php> hand">{$notify_num["friend"]}</span>条
                        </a>
                    </div>
                    <div style="width:23%"><a href="__APP__/space/{$mid}#wall">留言板<span class="<php>if($notify_num['wall']){ echo 'cRed fB f14px'; }else{ echo 'cGray2'; }</php> hand">{$notify_num["wall"]}
                            </span>条</a>
                    </div>
                </div>
                <div class="tab-menu"><!-- 切换标签 begin  -->
                    <div class="right" style="display:none;"><img src="../Public/images/ico_shezhi.gif" /> <a href="#">设置</a></div>
                    <ul>
                        <li><a href="javascript:void(0)" class="on feed_item" rel="all" id="feed_all_item"><span>全部动态</span></a></li>
                        
                        <!-- <li><a href="javascript:void(0)" class="feed_item" rel="3"><span>心情</span></a></li>
                        <li><a href="javascript:void(0)" class="feed_item" rel="10"><span>相册</span></a></li>
                        <li><a href="javascript:void(0)" class="feed_item" rel="4"><span>日志</span></a></li>
                        <li><a href="javascript:void(0)" class="feed_item" rel="11"><span>分享</span></a></li>
                        <li><a href="javascript:void(0)" class="feed_item" rel="13"><span>投票</span></a></li> 
                        <li><a href="javascript:void(0)" class="feed_item" rel="14"><span>活动</span></a></li>
                        <li><a href="javascript:void(0)" class="feed_item" rel="12"> <span>群组</span></a></li> -->
                    </ul>
                </div><!-- 切换标签 end  -->
                
                <div class="Friend" ><!-- 好友心情 begin  -->
    
                    <div class="FList" id="feed_content">
    
    
                    </div>
    
                    
                    <div class="alR lh35">
                    
                        <a href="###" id='getMoreFeed' class="U">点击查看更多...</a>
                    </div>
                </div><!-- 好友心情 end  -->
            </div>
		</div>
	 <div class="c"></div>
    </div><!-- 画布 end  -->
  <div class="c"></div>
</div><!-- 内容 end -->


<include file="__THEME__/footer" />
<!-- <script type="text/javascript" src="__APP__/Cron/run"></script> -->

